
<!doctype html>
<html class="no-js" lang="">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>Untitled Document</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="apple-touch-icon" href="apple-touch-icon.png">
    <!-- Place favicon.ico in the root directory -->

    <link rel="stylesheet" type="text/css" href="../../css/reset.css">
</head>

<body>
    <div class="loading">
        <span class="loadImg"></span>
    </div>
    <div class="prcAddClass">
        <div class="info inputList">
            <p><span>类型名称：</span><input type="text" class="t1 mel" name=""></p>
<!--             <p><span>类型logo：:</span>
    <input type="file" id="imgTest" class="mel" accept=".gif,.jpg,.jpeg,.png" name="">
    <input type="text" class="t2 none" name=""> 
</p> -->
            <p><span>类型状态：</span>
            <select class="t3">
                <option value="1">显示</option>
                <option value="2">隐藏</option>
            </select>
            </p>
            <p><span>类型排序：</span><input type="number" class="t4 sol" name=""></p>
            <div class="text"><span>商品描述:</span><textarea id="text" class="t5 log"></textarea></div>
            <p><button class="addClick">确认</button></p>   
        </div>
    </div>
</body>
<script src="../../js/jquery.js"></script>
<script src="../../js/jquery.cookie.js"></script>
<script type="text/javascript" src="../../js/nicEdit.js"></script>
<script type="text/javascript">
    bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
</script>
<script type="text/javascript">
    $(function(){
        

        $('.addClick').click(function(){
            var admintoken=$.cookie('admintoken');
            if(admintoken!=null){
                var name=$('.t1').val();
                //var logo=$('.t2').val();
                var status=$('.t3').val();
                var sort=$('.t4').val();
                var desc=$('.t5').val();
                if(name!=''){
                        var data={
                            "type_name":name,
                            "type_status":status,
                            "type_sort":sort,
                            "type_desc":desc
                        };
                        $('.loading').show();
                        $.ajax({
                            type: 'POST',
                            url:'http://www.math80.com/goods/type',
                            headers:{Authorization:"Bearer "+admintoken},
                            data:data,
                            success:function(data){
                                $('.loading').hide();
                                alert("添加成功")
                                $('input').val('')
                                $('.nicEdit-main').html('');
                            }
                        })   
                }
                
            }
            

        })



    })

</script>
</html>